#ifndef QPSearch_H
#define QPSearch_H

#include <QListWidget>
#include <QtNetwork>
#include <QtGui/QMainWindow>
#include <QtWebKit>
#include <QtDBus>
#include <qsysteminfo.h>
#include <QNetworkConfigurationManager>
#include <QNetworkSession>

// ---------------------------------------------------------------------------
// QPSearch
//
using namespace QtMobility;

class QPSearch: public QMainWindow
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "com.nokia.qpsearch")

public:
    QPSearch(QWidget *parent = 0);
    ~QPSearch();

    enum SearchEngine{
        Google,
        Yahoo,
        Bing
    };

private:
    void buildTabMenuBar(int index);
    QTabWidget* tabWidget;
    QString searchString;
    QWebView* tempview;
    QNetworkConfigurationManager *m_manager;
    QNetworkSession* session;

public slots:
    void activeTabChanged(int index);
    void enterSearch();
    void aboutDialog();
    //void testInternetSlot();
};

// ---------------------------------------------------------------------------
// QResultTabWgt
// ---------------------------------------------------------------------------
class QResultTabWgt: public QTabWidget
{
Q_OBJECT

private:
    QTabWidget *parentTabWidget;
    QListWidget *listWidget;
    QString resultTitle;
    QString resultDesc;
    QString resultUrl;
    QWebView* view;

    int searchEngine;
    QString searchString;

public:
    QResultTabWgt(int searchEngine, QTabWidget *parent = 0, QString searchString="");
    ~QResultTabWgt();

public slots:
    virtual void openItem(QListWidgetItem *item);
    void handleErrorInOpen(QListWidgetItem *item);
    void finishedSlot();

};

#endif // QPSearch_H
